package demo.hms.customer.contoller;

import demo.hms.customer.service.CustomerService;
import demo.hms.mybatis.entity.Customer;
import demo.hms.util.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/customer")
public class CustomerController {
    @Resource
    private CustomerService service;

    @RequestMapping(value = "/queryAll", method = RequestMethod.GET)
    public Result queryAll(Customer customer){
        return service.queryAll(customer);
    }

    @RequestMapping(value = "/insert", method = RequestMethod.GET)
    public Result insert(Customer customer){
        return service.insert(customer);
    }

    @RequestMapping(value = "/update", method = RequestMethod.GET)
    public Result update(Customer customer){
        return service.update(customer);
    }

}
